extends Camera2D
var speed = 10;
var lens_mode = "自由移动"
func _ready():
	pass # Replace with function body.
var velocity = Vector2()
func get_input():
	velocity = Vector2()
	if Input.is_action_pressed("d"):
		velocity.x += 1
	if Input.is_action_pressed("a"):
		velocity.x -= 1
	if Input.is_action_pressed("s"):
		velocity.y += 1
	if Input.is_action_pressed("w"):
		velocity.y -= 1
	velocity = velocity.normalized() * speed
#	if Input.is_mouse_button_pressed("up"):
#		zoom -= Vector2(0.1,0.1)
#	elif Input.is_mouse_button_pressed("down"):
#		zoom -= Vector2(0.1,0.1)
func _input(event):
	if event.is_action_pressed("down"):
		zoom -= Vector2(0.1,0.1)
	elif event.is_action_pressed("up"):
		zoom += Vector2(0.1,0.1)
func _process(delta):
	if(lens_mode == "自由移动"):
		get_input()
		position.x = lerp(position.x,position.x + velocity.x,speed*delta)
		position.y = lerp(position.y,position.y + velocity.y,speed*delta)
